package com.superlistaportable.sales;

import android.app.AlertDialog;
import android.content.DialogInterface;


public class SalesContinueDialog {
	
	private final SalesController controller;
	private AlertDialog alertDialog;
	
	public SalesContinueDialog(SalesController c) {
		controller = c;
		alertDialog = createAlertDialog();
	}
	
	private AlertDialog createAlertDialog() {
		// Use the Builder class for convenient dialog construction
		AlertDialog.Builder builder = new AlertDialog.Builder(controller.getActivity());
		builder.setMessage("No se pudo establecer la conexión")
		.setNeutralButton("Aceptar", new DialogInterface.OnClickListener() {
			public void onClick(DialogInterface dialog, int id) {
				// Continue search
				controller.returnToProductList();
			}
		});
		// Create the AlertDialog object and return it
		return builder.create();
	}
	
	public void show() {
		alertDialog.show();
	}
	
}

